const crypto = require('crypto');

// const log4js = require('log4js');
// log4js.configure({
//   appenders: { cheese: { type: 'file', filename: 'express-framework.log' } },
//   categories: { default: { appenders: ['cheese'], level: 'error' } }
// });

module.exports = {
    MD_SUFFIX : 'ThisIsMd5Suffix哈哈',
    md5 : function(str) {
        var obj = crypto.createHash('md5');

        obj.update(str+this.MD_SUFFIX); //一次md5签名，可以调用多次
        
        var md5Str = obj.digest('hex');
        
        // console.log(md5Str);
        return md5Str;
    }
}

